package com.wjx.reservation_service.service.impl;

import com.wjx.reservation_service.dao.ServeDao;
import com.wjx.reservation_service.model.Serve;
import com.wjx.reservation_service.service.IServeService;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IServeServiceImpl implements IServeService {
    @Autowired
    private ServeDao serveDao;
    //显示服务
    public List<Serve> showService(){
        return serveDao.queryAllService();
    }
    //根据关键词查询
    public List<Serve> search(String keyword){
        return serveDao.queryLikeService(keyword);
    }
    //根据id查询服务
    public Serve queryServiceById(int id){
        return serveDao.queryServiceById(id);
    }
    //根据服务名查询服务
    public Serve queryServiceByName(String name){
        return serveDao.queryServiceByName(name);
    }
    //根据id更新服务
    public int updateServiceById(Serve serve){
        return serveDao.updateServiceById(serve);
    }
    //根据id删除服务
    public int deleteServiceById(int id){
        return serveDao.deleteServiceById(id);
    }
    //添加服务
    public int insertService(Serve serve){
        return serveDao.insertService(serve);
    }
}
